home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr46 / be310.zip / STRIP.CHS < prev    next >
Text File  |  1993-06-01  |  1KB  |  35 lines

  1. /* CHESS FUNCTION(S): STRIP.CHS -- standalone program
  2. /*              DATE: 3/1/93
  3. /*            AUTHOR: C. Schanck
  4. /*
  5. /*       DESCRIPTION: This program strips comments out of a Chess program
  6. /* file.  It uses the regular expression search algorithm to find '/*' strings 
  7. /* which are not in strings.
  8. {
  9.    char com_target[40]; /* search target
  10.    int i;
  11.    
  12.    set_display(0);   /* turn the display update off
  13.  
  14.    Top_of_file();    /* all the way to the top
  15.    Begin_line();                                 
  16.    
  17.    /* now search for a '/*' string with no enclosing "
  18.    sformat(com_target,"search ~////[*][/~%c]*~ ~r~",34);
  19.    
  20.    while((i=Cmd_line(com_target)))  /* while you find them...
  21.    {
  22.       Del_eol();     /* del to eol
  23.    }         
  24.  
  25.    Top_of_file();    /* all the way to the top of the file...
  26.    Begin_line();
  27.    while(Search("~^$~ ~r~"))  /* search for each blank line...
  28.    {     
  29.       Del_line();    /* delete the line
  30.    }
  31.  
  32.    set_display(1);   /* turn the display back on
  33.    update_display(); /* update the display
  34.    return(1);        /* return success
  35. }